package com.community.common.controller;


import com.community.common.pojo.dto.DicDto;
import com.community.common.pojo.response.MyResponse;
import com.community.common.service.DicService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2021-01-21
 */
@RestController
@RequestMapping("/dic")
public class DicController {

    @Resource
    private DicService dicService;

    @ResponseBody
    @PostMapping
    public MyResponse insert(@RequestBody DicDto dicDto) {
        dicService.batchInsert(dicDto);
        return MyResponse.success("完美");
    }

    @ResponseBody
    @GetMapping("/gajg")
    public MyResponse gajg() {
        return MyResponse.success(dicService.list("GAJG"));
    }

    @ResponseBody
    @GetMapping("/xzqh")
    public MyResponse xzqh() {
        return MyResponse.success(dicService.list("XZQH"));
    }

    @ResponseBody
    @GetMapping("/sqdm")
    public MyResponse sqdm() {
        return MyResponse.success(dicService.list("SQDM"));
    }

    @ResponseBody
    @GetMapping("/fwztdm")
    public MyResponse fwztdm() {
        return MyResponse.success(dicService.list("FWZTDM"));
    }

}
